// use std::lazy::OnceCell;
// use crate::mut_demo::test1::Father;
use std::{
  cell::RefCell,
  sync::{Arc, Mutex},
};

static mut CELL: RefCell<i32> = RefCell::new(5);

fn test() {
  unsafe {
    let old_value = CELL.replace(6);
    assert_eq!(old_value, 5);
    assert_eq!(CELL, RefCell::new(6));
  }
}

struct Peripherals {
  serial: Option<i32>,
}
impl Peripherals {
  fn take_serial(&mut self) -> i32 {
    return 1;
  }
  fn take_serial_no_mut(&self) -> i32 {
    return 1;
  }
}
static PERIPHERALS: Peripherals = Peripherals { serial: Some(1) };

#[test]
fn test3() {
  // let ret = unsafe {
  println!("test3");
  PERIPHERALS.take_serial_no_mut();
  // };
}

